﻿	
	config.eventcfg = {
		mybao: function(){
			var records = this.grid.getSelectionModel().getSelections();
			if (!JxUtil.selected(records)) return;
			
			var self = this;
			var hdcall = function() {
				//取选择记录的主键值
				var params = 'funid='+ self.define.nodeid;
				for (var i = 0; i < records.length; i++) {
					params += '&keyid=' + records[i].get(self.define.pkcol);
				}

				var parentid = self.grid.destParentId;
				//设置请求的参数
				params += '&pagetype=selgrid&eventcode=mybao&parentId='+parentid;

				//执行处理的内容
				var endcall = function(data) {
					//重新加载数据
					self.grid.getStore().reload();
					
					//刷新目标表格
					var destGrid = self.grid.destGrid;
					if (destGrid != null) {
						destGrid.getStore().reload();
					}
				};

				//发送请求
				Request.postRequest(params, endcall);
			};
			
			Ext.Msg.confirm(jx.base.hint, '将对选择的投资计划进行合并实施，确定吗？', function(btn) {
				if (btn == 'yes') hdcall();
			});
		},
		
		imPlan: function(){
			var records = this.grid.getSelectionModel().getSelections();
			if (!JxUtil.selected(records)) return;
			
			var planids = '';
			for (var i = 0; i < records.length; i++) {
				var planid = records[i].get('money_plan__plan_id');
				planids += '&keyid=' + planid ;
			}
			
			var params = 'funid=money_select' + planids; 
			params += '&pagetype=grid&eventcode=imPlan';
			
			var self = this;
			var endcall = function(data) {
				//重新加载数据
				self.grid.getStore().reload();
				
				//刷新目标表格
				var destGrid = self.grid.destGrid;
				if (destGrid != null) {
					destGrid.getStore().reload();
				}	
			};

			//发送请求
			Request.postRequest(params, endcall);
		}
	};